package cn.edu.zafu.bigdata.XuShuXin.Exp1022;

public class XuShuxinStaticDemo_1 {
        static int count;
        int id;
        //静态代码块
        static {
            System.out.println("Static block executed!");
            count = 0;
        }
        //实例初始化代码块
        {
            System.out.println("Instance block executed!");
            this.id = count;
            count++;
        }
        //构造函数
        public XuShuxinStaticDemo_1() {
            System.out.println("Constructor executed for ID: [实例"+ this.id +"]");
        }

        public static void displayCount() {
            System.out.println("实例个数："+ count);
        }
}
